$(function() {
    showMap();
    showBarTimeLine();
    showRadar();
    showPieTimeLine()
    showBar2()
    showBarRadius()
})
function showMap() {
    var myChart = echarts.init(document.getElementById('maps'));
    $.getJSON('./src/js/zhejiang.json', function(zhejiang) {
        /* optional stuff to do after success */
        echarts.registerMap('zhejiang', zhejiang);
        var option = {
            tooltip: {},

            visualMap: {
                show: false,
                // min: 0,
                // max: 45000,
                seriesIndex: 0,
                left: 'left',
                top: 'bottom',
                text: [
                    '高', '低'
                ],
                calculable: true,
                color: ['#4DD5EF', '#2A54AD']
                // inRange: {
                //
                // }
            },
            color: [
                '#E93414',
                '#B91D1C',
                '#1E1D25',
                '#F99A1B',
                '#7FA51D',
                '#139AC2',
                '#005D93',
                '#48A325',
                '#ED5A0D',
                '#006C26',
                '#27972E',
                '#535F8D'
            ],
            series: [
                {
                    name: '浙江省企业分布情况',
                    type: 'map',
                    left: '5%',
                    y: 'center',
                    mapType: 'zhejiang',
                    label: {
                        normal: {
                            show: true,
                            textStyle: {
                                color: '#fff'
                            }
                        }

                    },
                    itemStyle: {
                        normal: {
                            borderColor: '#fff',
                            areaColor: '#4DD5EF'
                        },
                        emphasis: {
                            areaColor: '#389BB7',
                            borderWidth: 0
                        }
                    },
                    // animation: false,
                    data: [
                        {
                            name: '嘉兴市',
                            value: 63,
                            label: {
                                normal: {
                                    show: true
                                }
                            }
                        }, {
                            name: '舟山市',
                            value: 133,
                            label: {
                                normal: {
                                    show: true
                                }
                            }
                        }, {
                            name: '绍兴市',
                            value: 1863,
                            label: {
                                normal: {
                                    show: true
                                }
                            }
                        }, {
                            name: '杭州市',
                            value: 113,
                            label: {
                                normal: {
                                    show: true
                                }
                            }
                        }, {
                            name: '宁波市',
                            value: 186,
                            label: {
                                normal: {
                                    show: true
                                }
                            }
                        }, {
                            name: '台州市',
                            value: 1813,
                            label: {
                                normal: {
                                    show: true
                                }
                            }
                        }, {
                            name: '金华市',
                            value: 1281,
                            label: {
                                normal: {
                                    show: true
                                }
                            }
                        }, {
                            name: '衢州市',
                            value: 113,
                            label: {
                                normal: {
                                    show: true
                                }
                            }
                        }, {
                            name: '丽水市',
                            value: 1863,
                            label: {
                                normal: {
                                    show: true
                                }
                            }
                        }, {
                            name: '温州市',
                            value: 1863,
                            label: {
                                normal: {
                                    show: true
                                }
                            }
                        }, {
                            name: '湖州市',
                            value: 163,
                            label: {
                                normal: {
                                    show: true
                                }
                            }
                        }
                    ]
                    // animationDurationUpdate: 1000,
                    // animationEasingUpdate: 'quinticInOut'
                }, {
                    type: 'pie',
                    radius: [
                        '15%', '36%'
                    ],
                    center: [
                        '73%', '50%'
                    ],
                    tooltip: {
                        trigger: 'item',
                        formatter: "{b}: {c} ({d}%)"
                        // formatter: "{a} <br/>{b}: {c} ({d}%)"
                    },
                    label: {
                        normal: {
                            formatter: '{b} \n {d}%',
                            show: true,
                            textStyle: {
                                fontSize: '14',
                                color: '#97B8C9'
                            }

                        },
                        emphasis: {
                            show: true,
                            textStyle: {
                                fontSize: '14',
                                fontWeight: 'bold'
                            }
                        }
                    },
                    data: [
                        {
                            name: '危险化学品',
                            value: 232
                        }, {
                            name: '烟花爆竹',
                            value: 282
                        }, {
                            name: '非煤矿山',
                            value: 32
                        }, {
                            name: '冶金行业',
                            value: 232
                        }, {
                            name: '有色金属',
                            value: 332
                        }, {
                            name: '建材行业',
                            value: 282
                        }, {
                            name: '机械制造',
                            value: 233
                        }, {
                            name: '轻工业',
                            value: 632
                        }, {
                            name: '纺织工业',
                            value: 22
                        }, {
                            name: '烟草行业',
                            value: 32
                        }, {
                            name: '商贸行业',
                            value: 32
                        }, {
                            name: '其他',
                            value: 1232
                        }
                    ]
                }
            ]

        }
        myChart.setOption(option);
        myChart.on('click', function() {
            console.log(1);
            option.series[1].data = [

                {
                    name: '危险化学品',
                    value: 1232
                }, {
                    name: '烟花爆竹',
                    value: 2282
                }, {
                    name: '非煤矿山',
                    value: 32
                }, {
                    name: '冶金行业',
                    value: 232
                }, {
                    name: '有色金属',
                    value: 3232
                }, {
                    name: '建材行业',
                    value: 2832
                }, {
                    name: '机械制造',
                    value: 233
                }, {
                    name: '轻工业',
                    value: 632
                }, {
                    name: '纺织工业',
                    value: 122
                }, {
                    name: '烟草行业',
                    value: 132
                }, {
                    name: '商贸行业',
                    value: 32
                }, {
                    name: '其他',
                    value: 1232
                }

            ]
            myChart.setOption(option);
        })

    });

}
function showBarTimeLine() {

    var myChart = echarts.init(document.getElementById('bar-timeLine'));
    var option = {
        baseOption: {
            tooltip: {},
            timeline: {
                axisType: 'category',
                orient: 'vertical',
                autoPlay: true,
                inverse: true,
                playInterval: 5000,
                symbol: 'image://./src/img/time-line-icon.png',
                symbolSize: 10,
                left: null,
                right: 5,
                top: 58,
                bottom: 16,
                width: 46,
                height: null,
                label: {
                    normal: {
                        textStyle: {
                            color: '#4BCEEC'
                        }
                    },
                    emphasis: {
                        textStyle: {
                            color: '#97B8C9'
                        }
                    }
                },

                lineStyle: {
                    width: 1,
                    color: '#4BCEEC',
                    type: 'dotted'
                },
                checkpointStyle: {
                    symbol: 'image://./src/img/checkpoint-style-icon.png'
                },
                // checkpointStyle: {
                //     color: '#bbb',
                //     borderColor: '#777',
                //     borderWidth: 1
                // },
                controlStyle: {
                    show: false,
                    showNextBtn: false,
                    showPrevBtn: false,
                    normal: {
                        color: '#666',
                        borderColor: '#666'
                    },
                    emphasis: {
                        color: '#aaa',
                        borderColor: '#aaa'
                    }
                },
                itemStyle: {},
                data: ['2017', '2016', '2015', '2014', '2013']
            },
            grid: {
                left: '33%',
                right: '26%',
                bottom: '3%',
                // containLabel: true
            },
            yAxis: [
                {
                    type: 'category',
                    axisLine: {
                        show: true,
                        lineStyle: {
                            color: '#1178C9'
                        }
                    },
                    axisLabel: {
                        interval: 0,
                        textStyle: {
                            color: '#97B8C9'

                        },
                        formatter: function(params) {
                            if (params.length > 7) {
                                return params.substring(0, 7) + '\n' + params.substring(7, params.length)
                            }
                            return params
                        }

                    },
                    axisLine: {
                        show: true,
                        lineStyle: {
                            color: '#07274D'
                        }
                    },
                    axisTick: {
                        lineStyle: {
                            color: '#1178C9'
                        }
                    },
                    splitLine: {
                        show: true,
                        lineStyle: {
                            color: '#07274D'
                        }
                    },
                    data: [
                        '电离辐射', '矽尘', '镉及其化合物', '导致溃疡的危害因素', '导致解除性皮炎的危害因素'
                    ],
                    // axisTick: {
                    //     alignWithLabel: true
                    // }
                }

            ],
            xAxis: [
                {
                    type: 'value',
                    interval: 0,
                    splitLine: {
                        lineStyle: {
                            color: '#07274D'
                        }
                    },
                    axisLine: {
                        lineStyle: {
                            color: '#07274D'
                        }
                    },
                    axisTick: {
                        lineStyle: {
                            color: '#1178C9'
                        }
                    },
                    axisLabel: {
                        textStyle: {
                            color: '#97B8C9'

                        },
                        formatter: '{value} '
                    }
                }

            ],
            // tooltip: {
            //     trigger: 'item',
            //     formatter: "{a} <br/>{b} : {c} ({d}%)"
            // },
            // backgroundColor: '#fff',
            series: [
                {
                    name: '职业病危害因素Top5',
                    type: 'bar',
                    label: {
                        normal: {
                            show: true,
                            color: '#fff',
                            position: 'right'
                        }
                    }
                }
            ],
            color: ['#00acee', '#52cdd5', '#79d9f1', '#a7e7ff', '#c8efff']
        },
        options: [
            { // 这是'2017/02' 对应的 option

                series: [
                    {
                        data: [10, 52, 20, 334, 220]
                    }
                ]
            }, { // 这是'2017/02' 对应的 option

                series: [
                    {
                        data: [200, 34, 30, 330, 220]
                    }
                ]
            }, { // 这是'2017/02' 对应的 option

                series: [
                    {
                        data: [120, 334, 90, 330, 220]
                    }
                ]
            }, { // 这是'2017/02' 对应的 option

                series: [
                    {
                        data: [10, 52, 200, 334, 390]
                    }
                ]
            }, { // 这是'2017/02' 对应的 option
                // title: {
                //     text: '2017年1月份库存占比'
                // },
                series: [
                    {
                        data: [10, 52, 200, 334, 220]
                    }
                ]
            }
        ]
    };
    myChart.setOption(option);

}
function showRadar() {
    var myChart = echarts.init(document.getElementById('radar'));
    var option = {
        // title: {
        //     text: '基础雷达图'
        // },
        tooltip: {},
        legend: {
            data: [
                '危险化学品',
                '烟花爆竹',
                '非煤矿山',
                '冶金行业',
                '有色金属',
                '建设行业',
                '机械制造',
                '轻工业',
                '纺织工业',
                '商贸行业'
            ],
            orient: 'vertical',
            itemWidth: 14,
            top: '18%',
            left: 12,
            itemHeight: 8,
            textStyle: {
                color: '#97B8C9'
            },
            itemGap: 2
        },
        color: [
            '#E93414',
            '#B91D1C',
            '#1E1D25',
            '#F99A1B',
            '#7FA51D',
            '#139AC2',
            '#005D93',
            '#48A325',
            '#ED5A0D',
            '#27972E'
        ],
        radar: {
            // shape: 'circle',
            name: {
                textStyle: {
                    color: '#BBF3FF'
                }
            },
            nameGap: 2,
            center: [
                '63%', '56%'
            ],
            radius: '55%',
            splitLine: {
                lineStyle: {
                    color: '#0F77C3'
                }
            },
            splitArea: {
                show: true,
                areaStyle: {
                    color: ['#051E41', '#0A518C', '#051E41', '#051E41', '#051E41']
                }
            },
            indicator: [
                {
                    name: '标准化',
                    // max: 99999
                }, {
                    name: '隐患排查',
                    // max: 99999
                }, {
                    name: '事故情况',
                    // max: 99999
                }, {
                    name: '人员特征',
                    // max: 99999
                }, {
                    name: '日常检查',
                    // max: 99999
                }, {
                    name: '制度建设',
                    // max: 99999
                }
            ]
        },
        series: [
            {
                // name: '预算 vs 开销（Budget vs spending）',
                type: 'radar',
                // areaStyle: {normal: {}},

                data: [
                    {
                        value: [
                            4300,
                            10000,
                            28000,
                            35000,
                            50000,
                            19000
                        ],
                        name: '危险化学品'
                    }, {
                        value: [
                            5000,
                            14000,
                            28000,
                            31000,
                            42000,
                            21000
                        ],
                        name: '烟花爆竹'
                    }, {
                        value: [
                            5000,
                            14000,
                            28000,
                            31000,
                            42000,
                            21000
                        ],
                        name: '非煤矿山'
                    }, {
                        value: [
                            5000,
                            1400,
                            2800,
                            300,
                            4200,
                            2100
                        ],
                        name: '冶金行业'
                    }, {
                        value: [
                            500,
                            140,
                            2800,
                            3100,
                            420,
                            200
                        ],
                        name: '有色金属'
                    }, {
                        value: [
                            5000,
                            100,
                            200,
                            3000,
                            400,
                            200
                        ],
                        name: '建设行业'
                    }, {
                        value: [
                            5000,
                            4000,
                            8000,
                            1000,
                            2000,
                            1000
                        ],
                        name: '机械制造'
                    }, {
                        value: [
                            1500,
                            14000,
                            28000,
                            100,
                            200,
                            100
                        ],
                        name: '轻工业'
                    }, {
                        value: [
                            5000,
                            140,
                            2800,
                            31000,
                            420,
                            2100
                        ],
                        name: '纺织工业'
                    }, {
                        value: [
                            1500,
                            1000,
                            2800,
                            3100,
                            42000,
                            2100
                        ],
                        name: '商贸行业'
                    }
                ]
            }
        ]
    };
    myChart.setOption(option);

}

function showPieTimeLine() {

    var myChart = echarts.init(document.getElementById('pie-timeLine'));
    var option = {
        baseOption: {
            tooltip: {
                // trigger: 'axis'
            },
            legend: {
                itemWidth: 14,
                top: '8%',
                x: '33%',
                itemHeight: 8,
                textStyle: {
                    color: '#97B8C9'
                },
                itemGap: 8,
                data: [

                    '一级',
                    '二级',
                    '三级',
                    '未定级',
                    '标准化',
                    '诚信'
                ]
            },
            timeline: {
                axisType: 'category',
                orient: 'vertical',
                autoPlay: true,
                inverse: true,
                playInterval: 5000,
                symbol: 'image://./src/img/time-line-icon.png',
                symbolSize: 10,
                left: null,
                right: 5,
                top: 58,
                bottom: 16,
                width: 46,
                height: null,
                label: {
                    normal: {
                        textStyle: {
                            color: '#4BCEEC'
                        }
                    },
                    emphasis: {
                        textStyle: {
                            color: '#97B8C9'
                        }
                    }
                },

                lineStyle: {
                    width: 1,
                    color: '#4BCEEC',
                    type: 'dotted'
                },
                checkpointStyle: {
                    symbol: 'image://./src/img/checkpoint-style-icon.png'
                },
                // checkpointStyle: {
                //     color: '#bbb',
                //     borderColor: '#777',
                //     borderWidth: 1
                // },
                controlStyle: {
                    show: false,
                    showNextBtn: false,
                    showPrevBtn: false,
                    normal: {
                        color: '#666',
                        borderColor: '#666'
                    },
                    emphasis: {
                        color: '#aaa',
                        borderColor: '#aaa'
                    }
                },
                itemStyle: {},
                data: ['2017', '2016', '2015', '2014', '2013']
            },
            grid: {
                left: '40%',
                right: '13%',
                bottom: '18%',
                // containLabel: true
            },
            yAxis: [
                {
                    type: 'value',
                    // interval: 0,
                    splitLine: {
                        show: true,
                        lineStyle: {
                            color: '#07274D'
                        }
                    },
                    axisLine: {
                        show: false,

                        lineStyle: {
                            color: '#07274D'
                        }
                    },
                    axisTick: {
                        show: true,
                        lineStyle: {
                            color: '#1178C9'
                        }
                    },
                    axisLabel: {
                        show: true,
                        textStyle: {
                            color: '#97B8C9'

                        },
                        formatter: '{value} '
                    }
                }

            ],
            xAxis: [
                {
                    type: 'category',
                    axisLine: {
                        show: false,
                        lineStyle: {
                            color: '#1178C9'
                        }
                    },
                    axisLabel: {
                        interval: 0,
                        textStyle: {
                            color: '#97B8C9'

                        },
                        formatter: function(params) {
                            if (params.length > 7) {
                                return params.substring(0, 7) + '\n' + params.substring(7, params.length)
                            }
                            return params
                        }

                    },
                    axisLine: {
                        show: true,
                        lineStyle: {
                            color: '#07274D'
                        }
                    },
                    axisTick: {
                        lineStyle: {
                            color: '#1178C9'
                        }
                    },
                    splitLine: {
                        show: true,
                        lineStyle: {
                            color: '#07274D'
                        }
                    },
                    data: [
                        '一级', '二级', '三级', '未定级'
                    ],
                    // axisTick: {
                    //     alignWithLabel: true
                    // }
                }

            ],
            // tooltip: {
            //     trigger: 'item',
            //     formatter: "{a} <br/>{b} : {c} ({d}%)"
            // },
            // backgroundColor: '#fff',
            series: [
                {
                    name: '标准化',
                    type: 'bar',
                    stack: 2,
                    itemStyle: {
                        normal: {
                            color: '#4FE0FD'
                        }
                    }
                }, {
                    name: '诚信',
                    type: 'bar',
                    stack: 1,
                    itemStyle: {
                        normal: {
                            color: '#7630ED'
                        }
                    }
                }, {
                    name: '标准化等级分布情况',
                    type: 'pie',
                    tooltip: {
                        formatter: '{a}<br/> {b}:{c}({d}%)'
                    },
                    label: {
                        normal: {
                            position: 'inner',
                            formatter: '{d}%  '
                        }
                    },
                    radius: [
                        '10%', '38%'
                    ],
                    center: [
                        '18%', '58%'
                    ],

                    z: 100
                }, {
                    name: '诚信等级分布情况',
                    type: 'pie',
                    tooltip: {
                        formatter: '{a}<br/> {b}:{c}({d}%)'
                    },
                    label: {
                        normal: {
                            position: 'inner',
                            formatter: '{d}%  '
                        }
                    },
                    radius: [
                        '43%', '75%'
                    ],
                    center: [
                        '18%', '58%'
                    ],

                    z: 100
                }
            ],
            color: ['#3157EC', '#00A77B', '#F1951F', '#9C9C9C']
        },
        options: [
            { // 这是'2017/02' 对应的 option

                series: [
                    {
                        data: [10, 52, 334, 220]
                    }, {
                        data: [10, 52, 20, 220]
                    }, {
                        data: [
                            {
                                name: '一级',
                                value: 23
                            }, {
                                name: '二级',
                                value: 23
                            }, {
                                name: '三级',
                                value: 23
                            }, {
                                name: '未定级',
                                value: 23
                            }

                        ]
                    }, {
                        data: [
                            {
                                name: '一级',
                                value: 123
                            }, {
                                name: '二级',
                                value: 213
                            }, {
                                name: '三级',
                                value: 213
                            }, {
                                name: '未定级',
                                value: 213
                            }

                        ]
                    }
                ]
            }, { // 这是'2017/02' 对应的 option

                series: [
                    {
                        data: [200, 34, 30, 220]
                    }, {
                        data: [52, 20, 334, 220]
                    }, {
                        data: [
                            {
                                name: '一级',
                                value: 423
                            }, {
                                name: '二级',
                                value: 423
                            }, {
                                name: '三级',
                                value: 423
                            }, {
                                name: '未定级',
                                value: 423
                            }

                        ]
                    }, {
                        data: [
                            {
                                name: '一级',
                                value: 223
                            }, {
                                name: '二级',
                                value: 230
                            }, {
                                name: '三级',
                                value: 203
                            }, {
                                name: '未定级',
                                value: 203
                            }

                        ]
                    }
                ]
            }, { // 这是'2017/02' 对应的 option

                series: [
                    {
                        data: [120, 90, 330, 220]
                    }, {
                        data: [10, 52, 20, 334]
                    }, {
                        data: [
                            {
                                name: '一级',
                                value: 223
                            }, {
                                name: '二级',
                                value: 123
                            }, {
                                name: '三级',
                                value: 213
                            }, {
                                name: '未定级',
                                value: 283
                            }

                        ]
                    }, {
                        data: [
                            {
                                name: '一级',
                                value: 723
                            }, {
                                name: '二级',
                                value: 293
                            }, {
                                name: '三级',
                                value: 263
                            }, {
                                name: '未定级',
                                value: 243
                            }

                        ]
                    }
                ]
            }, { // 这是'2017/02' 对应的 option

                series: [
                    {
                        data: [10, 52, 334, 390]
                    }, {
                        data: [10, 20, 334, 220]
                    }, {
                        data: [
                            {
                                name: '一级',
                                value: 253
                            }, {
                                name: '二级',
                                value: 263
                            }, {
                                name: '三级',
                                value: 223
                            }, {
                                name: '未定级',
                                value: 273
                            }

                        ]
                    }, {
                        data: [
                            {
                                name: '一级',
                                value: 243
                            }, {
                                name: '二级',
                                value: 233
                            }, {
                                name: '三级',
                                value: 223
                            }, {
                                name: '未定级',
                                value: 213
                            }

                        ]
                    }
                ]
            }, { // 这是'2017/02' 对应的 option
                // title: {
                //     text: '2017年1月份库存占比'
                // },
                series: [
                    {
                        data: [10, 52, 334, 220]
                    }, {
                        data: [10, 52, 20, 220]
                    }, {
                        data: [
                            {
                                name: '一级',
                                value: 237
                            }, {
                                name: '二级',
                                value: 263
                            }, {
                                name: '三级',
                                value: 523
                            }, {
                                name: '未定级',
                                value: 283
                            }

                        ]
                    }, {
                        data: [
                            {
                                name: '一级',
                                value: 23
                            }, {
                                name: '二级',
                                value: 213
                            }, {
                                name: '三级',
                                value: 243
                            }, {
                                name: '未定级',
                                value: 263
                            }

                        ]
                    }
                ]
            }
        ]
    };
    myChart.setOption(option);

}

function showBar2() {
    var myChart = echarts.init(document.getElementById('bar2'));
    var option = {

        legend: {
            show: true,
            top: '8%',
            left: '37%',
            // formatter: function(name) {
            //     console.log(name);
            // },
            data: [
                '隐患排查数', '整改数', '整改率'

            ],
            itemWidth: 14,
            itemHeight: 8,
            textStyle: {
                color: '#97B8C9',
                fontSize: 12
            }
        },
        tooltip: {
            trigger: 'axis',
            formatter: function(params) {
                var str = '';

                $.each(params, function(index, el) {

                    if (!index) {
                        str += el.name + '<br/>' + '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + el.color + '"></span>' + el.seriesName + ' : ' + el.data + '<br/>';

                    } else if (index === params.length - 1) {
                        str += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + el.color + '"></span>' + el.seriesName + ' : ' + el.data + '%<br/>'

                    } else {
                        str += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + el.color + '"></span>' + el.seriesName + ' : ' + el.data + '<br/>'
                    }
                    // console.log(str);
                });
                return str
            }

        },
        grid: {
            top: '26%',
            left: '6%',
            right: '6%',
            bottom: '16%',
            containLabel: true
        },

        xAxis: {
            type: 'category',

            // boundaryGap: false,

            axisLine: {
                onZero: false,
                show: true,

                lineStyle: {
                    color: '#1178C9'
                }
            },
            axisLabel: {
                interval: 0,
                rotate: 45,
                // formatter: function(params) {
                //
                //     if (params.length > 4) {
                //         var _name = params.substring(0, 4) + '\n' + params.substring(4, params.length);
                //         return _name;
                //     }
                //     return params
                // },
                textStyle: {
                    color: '#97B8C9'

                }

            },
            axisLine: {
                show: true,
                lineStyle: {
                    color: '#07274D'
                }
            },
            axisTick: {
                show: true,
                lineStyle: {
                    color: '#1178C9'
                }
            },
            splitLine: {
                show: true,
                lineStyle: {
                    color: '#07274D'
                }
            },
            data: [
                '危险化学品',
                '烟花爆竹',
                '非煤矿山',
                '冶金行业',
                '有色金属',
                '建材行业',
                '机械制造',
                '轻工业',
                '纺织工业',
                '烟草行业',
                '商贸行业',
                '其他'

            ]
        },
        yAxis: [
            // {
            //     type: 'value',
            //     interval: 0,
            //      name: '户数',
            //     nameTextStyle: {
            //         color: '#FFFFFF',
            //         fontSize: 12
            //     },
            //     splitLine: {
            //         show: true,
            //         lineStyle: {
            //             color: '#07274D'
            //         }
            //     },
            //     axisLine: {
            //         show: true,
            //         onZero: false,
            //
            //         lineStyle: {
            //             color: '#07274D'
            //         }
            //     },
            //     axisTick: {
            //         show: true,
            //         lineStyle: {
            //             color: '#1178C9'
            //         }
            //     },
            //     axisLabel: {
            //         show: true,
            //         textStyle: {
            //             color: '#97B8C9'
            //
            //         }
            //
            //     }
            // }
            {
                type: 'value',
                name: '',
                splitNumber: 5,
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisLine: {

                    show: true,

                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisTick: {
                    show: true,
                    lineStyle: {
                        color: '#1178C9'
                    }
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: '#97B8C9'

                    }

                }
            }, {
                type: 'value',
                name: '',
                min: 0,
                max: 100,
                splitNumber: 5,
                splitLine: {
                    show: false,
                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisLine: {

                    show: false,

                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisTick: {
                    show: true,
                    lineStyle: {
                        color: '#1178C9'
                    }
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: '#97B8C9'

                    },
                    formatter: '{value}%'
                }
            }
        ],
        series: [
            {
                name: '隐患排查数',
                type: 'bar',

                itemStyle: {
                    normal: {
                        color: '#3157EC'
                        // color: function(value) {
                        //     var coloeList = [
                        //         '#7630ED',
                        //         '#EB3432',
                        //         '#3157EC',
                        //         '#F2E52C',
                        //         '#21FB30',
                        //         '#FF8516',
                        //         '#4FE0FD',
                        //         '#DF31EB',
                        //         '#A5D571'
                        //
                        //     ]
                        //     return coloeList[value.dataIndex]
                        //
                        // }
                    }
                },
                data: [
                    1,
                    22,
                    2,

                    3,
                    22,
                    2,
                    5,
                    23,
                    3,
                    12,
                    32,
                    123
                ]

            }, {
                name: '整改数',
                type: 'bar',
                itemStyle: {
                    normal: {
                        color: '#4FE0FD'
                    }
                },
                data: [
                    11,
                    122,
                    12,
                    321,
                    23,
                    13,
                    122,
                    12,
                    12,
                    1,
                    43,
                    23
                ]

            }, {
                name: '整改率',
                type: 'line',
                yAxisIndex: 1,
                itemStyle: {
                    normal: {
                        color: '#EB3432'
                    }
                },
                data: [
                    1,
                    22,
                    2,
                    5,
                    3,
                    22,
                    2,
                    32,
                    57,
                    23,
                    23,
                    45
                ]

            }
        ]
    };

    myChart.setOption(option);

}

function showBarRadius() {
    var myChart = echarts.init(document.getElementById('bar-radius'));
    var option = {
        tooltip: {
            trigger: 'item'
        },

        angleAxis: {
            axisLabel: {
                color: '#97B8C9',
                margin: 2
            },
            splitLine: {
                lineStyle: {
                    color: 'rgba(255,255,255,.2)'
                }
            },
            splitArea: {
                show: true,
                areaStyle: {
                    color: ['rgba(16,129,208,.2)']
                }
            },
            axisTick: {
                show: false
            }
        },
        radiusAxis: {
            show: false,
            // nameLocation: 'start',
            nameGap: 2,
            type: 'category',
            splitArea: {
                show: true,
                areaStyle: {
                    color: 'rgba(16,129,208,.2)'
                }
            },
            data: [
                '1',
                '2',
                '3',
                '4',
                '5',
                '6',
                '7',
                '8',
                '9',
                '10',
                '11',
                '12'
            ],
            z: 30
        },
        color: [
            '#BBF3FF',
            '#1178C9',
            '#4CAF50',
            '#8B572A',
            '#F8E71C',
            '#73BCF0',
            '#DC1F7A',
            '#EB3432',
            '#F5A623',
            '#7630ED',
            '#3157EC',
            '#6ECFE6',
            '#971F2E',
            '#9A911A',
            '#7ED321',
            '#5A3D23',
            '#563491',
            '#91949C',
            '#28335F',
            '#B09A75'
        ],
        polar: {
            // radius: [10, 20]
            center: ['63%', '50%']
        },
        series: [
            {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '物体打击',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '车体伤害',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    0,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '机械伤害',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '起重伤害',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '触电',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '淹溺',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '灼烫',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '火灾',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '高处坠落',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '坍塌',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '冒顶片帮',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '透水',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '放炮',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '火药爆炸',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '瓦斯爆炸',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '锅炉爆炸',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '容器爆炸',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '其他爆炸',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '中毒和窒息',
                stack: 'a'
            }, {
                type: 'bar',
                data: [
                    0,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                coordinateSystem: 'polar',
                center: [
                    '63%', '50%'
                ],

                name: '其他伤害',
                stack: 'a'
            }
        ],
        legend: {
            show: true,
            type: 'scroll',
            orient: 'vertical',
            left: '26px',
            pageIconColor: '#fff',
            pageIconInactiveColor: '#ACCAD0',
            pageTextStyle: {
                color: '#ACCAD0'
            },
            itemWidth: 14,
            itemHeight: 8,
            textStyle: {
                color: '#97B8C9',
                fontSize: 12
            },
            data: [
                '物体打击',
                '车体伤害',
                '机械伤害',
                '起重伤害',
                '触电',
                '淹溺',
                '灼烫',
                '火灾',
                '高处坠落',
                '坍塌',
                '冒顶片帮',
                '透水',
                '放炮',
                '火药爆炸',
                '瓦斯爆炸',
                '锅炉爆炸',
                '容器爆炸',
                '其他爆炸',
                '中毒和窒息',
                '其他伤害'
            ]
        }
    };

    myChart.setOption(option);

}
